<!DOCTYPE html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta content="user-scalable=no,width=device-width, initial-scale=1" id="viewport" name="viewport" initial-scale="1">

<script language="javascript" type="text/javascript" src="../js/js/baseJs.js"></script>

</head>
<body>

<div class="project-detail" id="projectDetail" style="display: none;">
  <div class="wap-header">项目详情
    <a class="back" onClick="javascript:window.history.back();return false;"></a>
  </div>
  <div class="project-bd"> 
      <div class="pr-content">
        <div class="pr-name"><span></span><div class="title">项目名称：</div><div class="content">{{projectData.name}}</div> </div>
        <div class="l-group"><div class="title">项目类别：</div><div class="content">{{projectData.category|category}}</div></div>
        <div class="l-group"><div class="title">赚钱条件：</div><div class="content">{{projectData.handleCondition}}</div></div>
        <!-- <div class="l-group"><div class="title">如何赚钱：</div><div class="content">{{projectData.makeMoney}}</div></div> -->
        <div class="l-group"><div class="title">项目介绍：</div><div class="content">{{projectData.productIntroduce}}</div></div>
        <div class="l-group"><div class="title">备注信息：</div><div class="content">{{projectData.doc}}</div></div>
        <a class="require-button" :href="getUploadPayUrl()">申请</a>
        <div class="share-project" @click="shareProject()" ><span class="ico"></span>分享朋友赚钱</div>
      </div>
      <div class="blue-block"></div>
  </div>
</div>
<script src="../js/js/rem_fix.js"></script>
<script src="../js/js/common.js"></script>
<script type="text/javascript">
  var url=window.location.hash;
  var id=url.split("#")[1];
  console.log(id)
  var invitationCode=getCookie("invitationCode");
  console.log(invitationCode)
  var projectDetailApp = new Vue({
      el: '#projectDetail',
      data: {
          projectData:'',
      },
      ready:function(){
        $("#projectDetail").show();        
        var url="/project/getProject";
        var data={id:id}
        pushData(url,data,function(res){
          console.log(res)
          if(res.state){
            this.projectData=res.data.project;
          }else{
            alert(res.message)
          }
        }.bind(this))

      },
      filters:{
        category: function (key) {
            key = parseInt(key);
            var map = {
                1: "平台型",
                2: "合作型",      
            };
            return map[key];
        }
      },
      methods:{
        getUploadPayUrl:function(){
          var url="";
          if(this.projectData.belong==3){
            url="/userBundle/uploadPayInfo.mobile.html"+"#"+id;
          }else if(this.projectData.belong==2){
            url="/userBundle/bankList.mobile.html"+"#"+id;
          }else{
            url="/userBundle/baseUploadProject.mobile.html"+"#"+id;
          }
          return url;
          
        },
        shareProject:function(){

            if(!invitationCode){
              window.location.href="/userBundle/login.mobile.html";
            }else{
              var url="../userBundle/shareProject.mobile.html"+"#"+id+"?"+"invitationCode="+invitationCode;
              window.location.href=url;
            }
            
        },
      }
    })
</script>

</body>
</html>